import request from '@/utils/request'

export function fetchMachineAppointmentList() {
  return request({
    url: '/machineappointments',
    method: 'get'
  })
}

export function fetchAppliedMachineAppointmentById(id) {
  return request({
    url: `/machineappointments/applied/${id}`,
    method: 'get'
  })
}

export function fetchMachineAppointmentById(id) {
  return request({
    url: `/machineappointments/${id}`,
    method: 'get'
  })
}

export function createMachineAppointment(data) {
  return request({
    url: '/machineappointments',
    method: 'post',
    data
  })
}

export function updateMachineAppointment(id, data) {
  return request({
    url: `/machineappointments/${id}`,
    method: 'put',
    data
  })
}

export function deleteMachineAppointment(id) {
    return request({
      url: `/machineappointments/${id}`,
      method: 'delete'
    })
}
  
